package com.lijie.ljblog.util;

import lombok.Data;
import org.springframework.web.socket.WebSocketSession;

import java.util.Objects;

/**
 * @Description 五子棋机器人
 * @Author lijie
 * @Date 2022/8/26 10:12
 **/
@Data
public class GoBangBotUtil {
    public static Integer getUserId(WebSocketSession session) {
        String query = Objects.requireNonNull(session.getUri()).getQuery();
        String[] split = query.split("=");
        if (split.length>=2){
            return Integer.parseInt(split[1]);
        }
        return null;
    }
    GoBangBotUtil(){

    }



}
